home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1996 July / Macworld (1996-07).dmg / For your System Folder / Sound Manager 3.2a2 / Sound.p < prev    next >
Text File  |  1995-11-24  |  24KB  |  692 lines

  1. {
  2.      File:        Sound.p
  3.  
  4.      Contains:    Sound Manager Interfaces.
  5.  
  6.      Version:    ETO
  7.  
  8.      DRI:        Jim Reekes
  9.  
  10.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  11.                  All rights reserved.
  12.  
  13.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  14.                  stack.  Include the file and version information (from above)
  15.                  in the problem description and send to:
  16.                      Internet:    apple.bugs@applelink.apple.com
  17.                      AppleLink:    APPLE.BUGS
  18.  
  19. }
  20.  
  21. {$IFC UNDEFINED UsingIncludes}
  22. {$SETC UsingIncludes := 0}
  23. {$ENDC}
  24.  
  25. {$IFC NOT UsingIncludes}
  26.  UNIT Sound;
  27.  INTERFACE
  28. {$ENDC}
  29.  
  30. {$IFC UNDEFINED __SOUND__}
  31. {$SETC __SOUND__ := 1}
  32.  
  33. {$I+}
  34. {$SETC SoundIncludes := UsingIncludes}
  35. {$SETC UsingIncludes := 1}
  36.  
  37.  
  38. {$IFC UNDEFINED __TYPES__}
  39. {$I Types.p}
  40. {$ENDC}
  41. {    ConditionalMacros.p                                            }
  42.  
  43. {$IFC UNDEFINED __COMPONENTS__}
  44. {$I Components.p}
  45. {$ENDC}
  46. {    MixedMode.p                                                    }
  47.  
  48. {$IFC UNDEFINED __MIXEDMODE__}
  49. {$I MixedMode.p}
  50. {$ENDC}
  51.  
  52. {$PUSH}
  53. {$ALIGN MAC68K}
  54. {$LibExport+}
  55. {
  56.                         * * *  N O T E  * * *
  57.  
  58.     This file has been updated to include Sound Manager 3.2 interfaces.
  59.  
  60.     Some of the Sound Manager 3.0 interfaces were not put into the InterfaceLib
  61.     that originally shipped with the PowerMacs. These missing functions and the
  62.     new 3.2 interfaces have been released in the SoundLib library for PowerPC
  63.     developers to link with. The runtime library for these functions are
  64.     installed by Sound Manager 3.2. The following functions are found in SoundLib.
  65.  
  66.         GetCompressionInfo(), GetSoundPreference(), SetSoundPreference(),
  67.         UnsignedFixedMulDiv(), SndGetInfo(), SndSetInfo(), GetSoundOutputInfo(),
  68.         SetSoundOutputInfo(), GetCompressionName(), SoundConverterOpen(),
  69.         SoundConverterClose(), SoundConverterGetBufferSizes(), SoundConverterBeginConversion(),
  70.         SoundConverterConvertBuffer(), SoundConverterEndConversion()
  71. }
  72. {
  73.     Interfaces for Sound Driver, !!! OBSOLETE and NOT SUPPORTED !!!
  74.  
  75.     These items are no longer defined, but appear here so that someone
  76.     searching the interfaces might find them. If you are using one of these
  77.     items, you must change your code to support the Sound Manager.
  78.  
  79.         swMode, ftMode, ffMode
  80.         FreeWave, FFSynthRec, Tone, SWSynthRec, Wave, FTSoundRec
  81.         SndCompletionProcPtr
  82.         StartSound, StopSound, SoundDone
  83. }
  84. CONST
  85.     twelfthRootTwo                = 1.05946309435;
  86.     soundListRsrc                = 'snd ';                        {Resource type used by Sound Manager}
  87.     rate44khz                    = $AC440000;                    {44100.00000 in fixed-point}
  88.     rate22050hz                    = $56220000;                    {22050.00000 in fixed-point}
  89.     rate22khz                    = $56EE8BA3;                    {22254.54545 in fixed-point}
  90.     rate11khz                    = $2B7745D1;                    {11127.27273 in fixed-point}
  91.     rate11025hz                    = $2B110000;                    {11025.00000 in fixed-point}
  92. {synthesizer numbers for SndNewChannel}
  93.     squareWaveSynth                = 1;                            {square wave synthesizer}
  94.     waveTableSynth                = 3;                            {wave table synthesizer}
  95.     sampledSynth                = 5;                            {sampled sound synthesizer}
  96. {old Sound Manager MACE synthesizer numbers}
  97.     MACE3snthID                    = 11;
  98.     MACE6snthID                    = 13;
  99.     kMiddleC                    = 60;                            {MIDI note value for middle C}
  100.     kSimpleBeepID                = 1;                            {reserved resource ID for Simple Beep}
  101.     kFullVolume                    = $0100;                        {1.0, setting for full hardware output volume}
  102.     kNoVolume                    = 0;                            {setting for no sound volume}
  103. {command numbers for SndDoCommand and SndDoImmediate}
  104.     nullCmd                        = 0;
  105.     initCmd                        = 1;
  106.     freeCmd                        = 2;
  107.     quietCmd                    = 3;
  108.     flushCmd                    = 4;
  109.     reInitCmd                    = 5;
  110.     waitCmd                        = 10;
  111.     pauseCmd                    = 11;
  112.     resumeCmd                    = 12;
  113.     callBackCmd                    = 13;
  114.  
  115.     syncCmd                        = 14;
  116.     availableCmd                = 24;
  117.     versionCmd                    = 25;
  118.     totalLoadCmd                = 26;
  119.     loadCmd                        = 27;
  120.     freqDurationCmd                = 40;
  121.     restCmd                        = 41;
  122.     freqCmd                        = 42;
  123.     ampCmd                        = 43;
  124.     timbreCmd                    = 44;
  125.     getAmpCmd                    = 45;
  126.     volumeCmd                    = 46;                            {sound manager 3.0 or later only}
  127.     getVolumeCmd                = 47;                            {sound manager 3.0 or later only}
  128.     waveTableCmd                = 60;
  129.     phaseCmd                    = 61;
  130.  
  131.     soundCmd                    = 80;
  132.     bufferCmd                    = 81;
  133.     rateCmd                        = 82;
  134.     continueCmd                    = 83;
  135.     doubleBufferCmd                = 84;
  136.     getRateCmd                    = 85;
  137.     rateMultiplierCmd            = 86;
  138.     getRateMultiplierCmd        = 87;
  139.     sizeCmd                        = 90;                            {obsolete command}
  140.     convertCmd                    = 91;                            {obsolete MACE command}
  141.     stdQLength                    = 128;
  142.     dataOffsetFlag                = $8000;
  143.  
  144. {channel initialization parameters}
  145. {$IFC OLDROUTINENAMES }
  146.     waveInitChannelMask            = $07;
  147.     waveInitChannel0            = $04;                            {wave table only, Sound Manager 2.0 and earlier}
  148.     waveInitChannel1            = $05;                            {wave table only, Sound Manager 2.0 and earlier}
  149.     waveInitChannel2            = $06;                            {wave table only, Sound Manager 2.0 and earlier}
  150.     waveInitChannel3            = $07;                            {wave table only, Sound Manager 2.0 and earlier}
  151.     initChan0                    = waveInitChannel0;                {obsolete spelling}
  152.     initChan1                    = waveInitChannel1;                {obsolete spelling}
  153.     initChan2                    = waveInitChannel2;                {obsolete spelling}
  154.     initChan3                    = waveInitChannel3;                {obsolete spelling}
  155.  
  156. {$ENDC}
  157.     initChanLeft                = $0002;                        {left stereo channel}
  158.     initChanRight                = $0003;                        {right stereo channel}
  159.     initNoInterp                = $0004;                        {no linear interpolation}
  160.     initNoDrop                    = $0008;                        {no drop-sample conversion}
  161.     initMono                    = $0080;                        {monophonic channel}
  162.     initStereo                    = $00C0;                        {stereo channel}
  163.     initMACE3                    = $0300;                        {MACE 3:1}
  164.     initMACE6                    = $0400;                        {MACE 6:1}
  165.     initPanMask                    = $0003;                        {mask for right/left pan values}
  166.     initSRateMask                = $0030;                        {mask for sample rate values}
  167.     initStereoMask                = $00C0;                        {mask for mono/stereo values}
  168.     initCompMask                = $FF00;                        {mask for compression IDs}
  169.     kUseOptionalOutputDevice    = -1;                            {only for Sound Manager 3.0 or later}
  170.     notCompressed                = 0;                            {compression ID's}
  171.     fixedCompression            = -1;                            {compression ID for fixed-sized compression}
  172.     variableCompression            = -2;                            {compression ID for variable-sized compression}
  173.     twoToOne                    = 1;
  174.     eightToThree                = 2;
  175.     threeToOne                    = 3;
  176.     sixToOne                    = 4;
  177.  
  178.     stdSH                        = $00;                            {Standard sound header encode value}
  179.     extSH                        = $FF;                            {Extended sound header encode value}
  180.     cmpSH                        = $FE;                            {Compressed sound header encode value}
  181.  
  182.     outsideCmpSH                = 0;                            {obsolete MACE constant}
  183.     insideCmpSH                    = 1;                            {obsolete MACE constant}
  184.     aceSuccess                    = 0;                            {obsolete MACE constant}
  185.     aceMemFull                    = 1;                            {obsolete MACE constant}
  186.     aceNilBlock                    = 2;                            {obsolete MACE constant}
  187.     aceBadComp                    = 3;                            {obsolete MACE constant}
  188.     aceBadEncode                = 4;                            {obsolete MACE constant}
  189.     aceBadDest                    = 5;                            {obsolete MACE constant}
  190.     aceBadCmd                    = 6;                            {obsolete MACE constant}
  191.     sixToOnePacketSize            = 8;
  192.     threeToOnePacketSize        = 16;
  193.     stateBlockSize                = 64;
  194.     leftOverBlockSize            = 32;
  195.     firstSoundFormat            = $0001;                        {general sound format}
  196.     secondSoundFormat            = $0002;                        {special sampled sound format (HyperCard)}
  197.     dbBufferReady                = $00000001;                    {double buffer is filled}
  198.     dbLastBuffer                = $00000004;                    {last double buffer to play}
  199.     sysBeepDisable                = $0000;                        {SysBeep() enable flags}
  200.     sysBeepEnable                = 0+(1 * (2**(0)));
  201.     sysBeepSynchronous            = 0+(1 * (2**(1)));                {if bit set, make alert sounds synchronous}
  202.     unitTypeNoSelection            = $FFFF;                        {unitTypes for AudioSelection.unitType}
  203.     unitTypeSeconds                = $0000;
  204.  
  205. { unsigned fixed-point number }
  206.     
  207. TYPE
  208.     UnsignedFixed = LONGINT;
  209.  
  210.     SndCommand = PACKED RECORD
  211.         cmd:                    INTEGER;
  212.         param1:                    INTEGER;
  213.         param2:                    LONGINT;
  214.     END;
  215.  
  216.     SndChannelPtr = ^SndChannel;
  217.  
  218.     SndCallBackProcPtr = ProcPtr;  { PROCEDURE SndCallBack(chan: SndChannelPtr; VAR cmd: SndCommand); }
  219.     SndCallBackUPP = UniversalProcPtr;
  220.  
  221.     SndChannel = PACKED RECORD
  222.         nextChan:                SndChannelPtr;
  223.         firstMod:                Ptr;                                    { reserved for the Sound Manager }
  224.         callBack:                SndCallBackUPP;
  225.         userInfo:                LONGINT;
  226.         wait:                    LONGINT;                                { The following is for internal Sound Manager use only.}
  227.         cmdInProgress:            SndCommand;
  228.         flags:                    INTEGER;
  229.         qLength:                INTEGER;
  230.         qHead:                    INTEGER;
  231.         qTail:                    INTEGER;
  232.         queue:                    ARRAY [0..stdQLength-1] OF SndCommand;
  233.     END;
  234.  
  235. {MACE structures}
  236.     StateBlock = RECORD
  237.         stateVar:                ARRAY [0..stateBlockSize-1] OF INTEGER;
  238.     END;
  239.  
  240.     StateBlockPtr = ^StateBlock;
  241.  
  242.     LeftOverBlock = RECORD
  243.         count:                    LONGINT;
  244.         sampleArea:                PACKED ARRAY [0..leftOverBlockSize-1] OF SInt8;
  245.     END;
  246.  
  247.     LeftOverBlockPtr = ^LeftOverBlock;
  248.  
  249.     ModRef = RECORD
  250.         modNumber:                INTEGER;
  251.         modInit:                LONGINT;
  252.     END;
  253.  
  254.     SndListResource = RECORD
  255.         format:                    INTEGER;
  256.         numModifiers:            INTEGER;
  257.         modifierPart:            ARRAY [0..0] OF ModRef;                    {This is a variable length array}
  258.         numCommands:            INTEGER;
  259.         commandPart:            ARRAY [0..0] OF SndCommand;                {This is a variable length array}
  260.         dataPart:                PACKED ARRAY [0..0] OF SInt8;            {This is a variable length array}
  261.     END;
  262.  
  263.     SndListPtr = ^SndListResource;
  264.  
  265.     SndListHndl = ^SndListPtr;
  266.     SndListHandle = ^SndListPtr;
  267.  
  268. {HyperCard sound resource format}
  269.     Snd2ListResource = RECORD
  270.         format:                    INTEGER;
  271.         refCount:                INTEGER;
  272.         numCommands:            INTEGER;
  273.         commandPart:            ARRAY [0..0] OF SndCommand;                {This is a variable length array}
  274.         dataPart:                PACKED ARRAY [0..0] OF SInt8;            {This is a variable length array}
  275.     END;
  276.  
  277.     Snd2ListPtr = ^Snd2ListResource;
  278.  
  279.     Snd2ListHndl = ^Snd2ListPtr;
  280.     Snd2ListHandle = ^Snd2ListPtr;
  281.  
  282.     SoundHeader = PACKED RECORD
  283.         samplePtr:                Ptr;                                    {if NIL then samples are in sampleArea}
  284.         length:                    LONGINT;                                {length of sound in bytes}
  285.         sampleRate:                UnsignedFixed;                            {sample rate for this sound}
  286.         loopStart:                LONGINT;                                {start of looping portion}
  287.         loopEnd:                LONGINT;                                {end of looping portion}
  288.         encode:                    UInt8;                                    {header encoding}
  289.         baseFrequency:            UInt8;                                    {baseFrequency value}
  290.         sampleArea:                PACKED ARRAY [0..0] OF SInt8;            {space for when samples follow directly}
  291.     END;
  292.  
  293.     SoundHeaderPtr = ^SoundHeader;
  294.  
  295.     CmpSoundHeader = PACKED RECORD
  296.         samplePtr:                Ptr;                                    {if nil then samples are in sample area}
  297.         numChannels:            LONGINT;                                {number of channels i.e. mono = 1}
  298.         sampleRate:                UnsignedFixed;                            {sample rate in Apples Fixed point representation}
  299.         loopStart:                LONGINT;                                {loopStart of sound before compression}
  300.         loopEnd:                LONGINT;                                {loopEnd of sound before compression}
  301.         encode:                    UInt8;                                    {data structure used , stdSH, extSH, or cmpSH}
  302.         baseFrequency:            UInt8;                                    {same meaning as regular SoundHeader}
  303.         numFrames:                LONGINT;                                {length in frames ( packetFrames or sampleFrames )}
  304.         AIFFSampleRate:            extended80;                                {IEEE sample rate}
  305.         markerChunk:            Ptr;                                    {sync track}
  306.         format:                    OSType;                                    {data format type, was futureUse1}
  307.         futureUse2:                LONGINT;                                {reserved by Apple}
  308.         stateVars:                StateBlockPtr;                            {pointer to State Block}
  309.         leftOverSamples:        LeftOverBlockPtr;                        {used to save truncated samples between compression calls}
  310.         compressionID:            INTEGER;                                {0 means no compression, non zero means compressionID}
  311.         packetSize:                INTEGER;                                {number of bits in compressed sample packet}
  312.         snthID:                    INTEGER;                                {resource ID of Sound Manager snth that contains NRT C/E}
  313.         sampleSize:                INTEGER;                                {number of bits in non-compressed sample}
  314.         sampleArea:                PACKED ARRAY [0..0] OF SInt8;            {space for when samples follow directly}
  315.     END;
  316.  
  317.     CmpSoundHeaderPtr = ^CmpSoundHeader;
  318.  
  319.     ExtSoundHeader = PACKED RECORD
  320.         samplePtr:                Ptr;                                    {if nil then samples are in sample area}
  321.         numChannels:            LONGINT;                                {number of channels,  ie mono = 1}
  322.         sampleRate:                UnsignedFixed;                            {sample rate in Apples Fixed point representation}
  323.         loopStart:                LONGINT;                                {same meaning as regular SoundHeader}
  324.         loopEnd:                LONGINT;                                {same meaning as regular SoundHeader}
  325.         encode:                    UInt8;                                    {data structure used , stdSH, extSH, or cmpSH}
  326.         baseFrequency:            UInt8;                                    {same meaning as regular SoundHeader}
  327.         numFrames:                LONGINT;                                {length in total number of frames}
  328.         AIFFSampleRate:            extended80;                                {IEEE sample rate}
  329.         markerChunk:            Ptr;                                    {sync track}
  330.         instrumentChunks:        Ptr;                                    {AIFF instrument chunks}
  331.         AESRecording:            Ptr;
  332.         sampleSize:                INTEGER;                                {number of bits in sample}
  333.         futureUse1:                INTEGER;                                {reserved by Apple}
  334.         futureUse2:                LONGINT;                                {reserved by Apple}
  335.         futureUse3:                LONGINT;                                {reserved by Apple}
  336.         futureUse4:                LONGINT;                                {reserved by Apple}
  337.         sampleArea:                PACKED ARRAY [0..0] OF SInt8;            {space for when samples follow directly}
  338.     END;
  339.  
  340.     ExtSoundHeaderPtr = ^ExtSoundHeader;
  341.  
  342.     ConversionBlock = RECORD
  343.         destination:            INTEGER;
  344.         unused:                    INTEGER;
  345.         inputPtr:                CmpSoundHeaderPtr;
  346.         outputPtr:                CmpSoundHeaderPtr;
  347.     END;
  348.  
  349.     ConversionBlockPtr = ^ConversionBlock;
  350.  
  351.     SMStatus = PACKED RECORD
  352.         smMaxCPULoad:            INTEGER;
  353.         smNumChannels:            INTEGER;
  354.         smCurCPULoad:            INTEGER;
  355.     END;
  356.  
  357.     SMStatusPtr = ^SMStatus;
  358.  
  359.     SCStatus = RECORD
  360.         scStartTime:            UnsignedFixed;
  361.         scEndTime:                UnsignedFixed;
  362.         scCurrentTime:            UnsignedFixed;
  363.         scChannelBusy:            BOOLEAN;
  364.         scChannelDisposed:        BOOLEAN;
  365.         scChannelPaused:        BOOLEAN;
  366.         scUnused:                BOOLEAN;
  367.         scChannelAttributes:    LONGINT;
  368.         scCPULoad:                LONGINT;
  369.     END;
  370.  
  371.     SCStatusPtr = ^SCStatus;
  372.  
  373.     AudioSelection = PACKED RECORD
  374.         unitType:                LONGINT;
  375.         selStart:                UnsignedFixed;
  376.         selEnd:                    UnsignedFixed;
  377.     END;
  378.  
  379.     FilePlayCompletionProcPtr = ProcPtr;  { PROCEDURE FilePlayCompletion(chan: SndChannelPtr); }
  380.     FilePlayCompletionUPP = UniversalProcPtr;
  381.  
  382. CONST
  383.     uppFilePlayCompletionProcInfo = $000000C0; { PROCEDURE (4 byte param); }
  384.  
  385. FUNCTION NewFilePlayCompletionProc(userRoutine: FilePlayCompletionProcPtr): FilePlayCompletionUPP;
  386.     {$IFC NOT GENERATINGCFM }
  387.     INLINE $2E9F;
  388.     {$ENDC}
  389.  
  390. PROCEDURE CallFilePlayCompletionProc(chan: SndChannelPtr; userRoutine: FilePlayCompletionUPP);
  391.     {$IFC NOT GENERATINGCFM}
  392.     INLINE $205F, $4E90;
  393.     {$ENDC}
  394.     
  395. TYPE
  396.     AudioSelectionPtr = ^AudioSelection;
  397.  
  398.     SndDoubleBuffer = PACKED RECORD
  399.         dbNumFrames:            LONGINT;
  400.         dbFlags:                LONGINT;
  401.         dbUserInfo:                ARRAY [0..1] OF LONGINT;
  402.         dbSoundData:            PACKED ARRAY [0..0] OF SInt8;
  403.     END;
  404.  
  405.     SndDoubleBufferPtr = ^SndDoubleBuffer;
  406.  
  407.     SndDoubleBackProcPtr = ProcPtr;  { PROCEDURE SndDoubleBack(channel: SndChannelPtr; doubleBufferPtr: SndDoubleBufferPtr); }
  408.     SndDoubleBackUPP = UniversalProcPtr;
  409.  
  410. CONST
  411.     uppSndDoubleBackProcInfo = $000003C0; { PROCEDURE (4 byte param, 4 byte param); }
  412.  
  413. FUNCTION NewSndDoubleBackProc(userRoutine: SndDoubleBackProcPtr): SndDoubleBackUPP;
  414.     {$IFC NOT GENERATINGCFM }
  415.     INLINE $2E9F;
  416.     {$ENDC}
  417.  
  418. PROCEDURE CallSndDoubleBackProc(channel: SndChannelPtr; doubleBufferPtr: SndDoubleBufferPtr; userRoutine: SndDoubleBackUPP);
  419.     {$IFC NOT GENERATINGCFM}
  420.     INLINE $205F, $4E90;
  421.     {$ENDC}
  422.  
  423. TYPE
  424.     SndDoubleBufferHeader = PACKED RECORD
  425.         dbhNumChannels:            INTEGER;
  426.         dbhSampleSize:            INTEGER;
  427.         dbhCompressionID:        INTEGER;
  428.         dbhPacketSize:            INTEGER;
  429.         dbhSampleRate:            UnsignedFixed;
  430.         dbhBufferPtr:            ARRAY [0..1] OF SndDoubleBufferPtr;
  431.         dbhDoubleBack:            SndDoubleBackUPP;
  432.     END;
  433.  
  434.     SndDoubleBufferHeaderPtr = ^SndDoubleBufferHeader;
  435.  
  436.     SndDoubleBufferHeader2 = PACKED RECORD
  437.         dbhNumChannels:            INTEGER;
  438.         dbhSampleSize:            INTEGER;
  439.         dbhCompressionID:        INTEGER;
  440.         dbhPacketSize:            INTEGER;
  441.         dbhSampleRate:            UnsignedFixed;
  442.         dbhBufferPtr:            ARRAY [0..1] OF SndDoubleBufferPtr;
  443.         dbhDoubleBack:            SndDoubleBackUPP;
  444.         dbhFormat:                OSType;
  445.     END;
  446.  
  447.     SndDoubleBufferHeader2Ptr = ^SndDoubleBufferHeader2;
  448.  
  449.     SoundInfoList = PACKED RECORD
  450.         count:                    INTEGER;
  451.         infoHandle:                Handle;
  452.     END;
  453.  
  454.     SoundInfoListPtr = ^SoundInfoList;
  455.  
  456.     SoundComponentData = RECORD
  457.         flags:                    LONGINT;
  458.         format:                    OSType;
  459.         numChannels:            INTEGER;
  460.         sampleSize:                INTEGER;
  461.         sampleRate:                UnsignedFixed;
  462.         sampleCount:            LONGINT;
  463.         buffer:                    ^Byte;
  464.         reserved:                LONGINT;
  465.     END;
  466.  
  467.     SoundComponentDataPtr = ^SoundComponentData;
  468.  
  469.     CompressionInfo = RECORD
  470.         recordSize:                LONGINT;
  471.         format:                    OSType;
  472.         compressionID:            INTEGER;
  473.         samplesPerPacket:        INTEGER;
  474.         bytesPerPacket:            INTEGER;
  475.         bytesPerFrame:            INTEGER;
  476.         bytesPerSample:            INTEGER;
  477.         futureUse1:                INTEGER;
  478.     END;
  479.  
  480.     CompressionInfoPtr = ^CompressionInfo;
  481.  
  482.     CompressionInfoHandle = ^CompressionInfoPtr;
  483.  
  484.     SoundConverter = Ptr;
  485.  
  486. { These two routines for Get/SetSoundVol should no longer be used.}
  487. { They were for old Apple Sound Chip machines, and do not support the DSP or PowerMacs.}
  488. { Use Get/SetDefaultOutputVolume instead, if you must change the user's machine.}
  489. {$IFC OLDROUTINENAMES  & NOT GENERATINGCFM }
  490.  
  491. PROCEDURE SetSoundVol(level: INTEGER);
  492. PROCEDURE GetSoundVol(VAR level: INTEGER);
  493.     {$IFC NOT GENERATINGCFM}
  494.     INLINE $205F, $4218, $10B8, $0260;
  495.     {$ENDC}
  496. {$ENDC}
  497.  
  498. FUNCTION SndDoCommand(chan: SndChannelPtr; {CONST}VAR cmd: SndCommand; noWait: BOOLEAN): OSErr;
  499.     {$IFC NOT GENERATINGCFM}
  500.     INLINE $A803;
  501.     {$ENDC}
  502. FUNCTION SndDoImmediate(chan: SndChannelPtr; {CONST}VAR cmd: SndCommand): OSErr;
  503.     {$IFC NOT GENERATINGCFM}
  504.     INLINE $A804;
  505.     {$ENDC}
  506. FUNCTION SndNewChannel(VAR chan: SndChannelPtr; synth: INTEGER; init: LONGINT; userRoutine: SndCallBackUPP): OSErr;
  507.     {$IFC NOT GENERATINGCFM}
  508.     INLINE $A807;
  509.     {$ENDC}
  510. FUNCTION SndDisposeChannel(chan: SndChannelPtr; quietNow: BOOLEAN): OSErr;
  511.     {$IFC NOT GENERATINGCFM}
  512.     INLINE $A801;
  513.     {$ENDC}
  514. FUNCTION SndPlay(chan: SndChannelPtr; sndHandle: SndListHandle; async: BOOLEAN): OSErr;
  515.     {$IFC NOT GENERATINGCFM}
  516.     INLINE $A805;
  517.     {$ENDC}
  518. {$IFC OLDROUTINENAMES }
  519. FUNCTION SndAddModifier(chan: SndChannelPtr; modifier: Ptr; id: INTEGER; init: LONGINT): OSErr;
  520.     {$IFC NOT GENERATINGCFM}
  521.     INLINE $A802;
  522.     {$ENDC}
  523. {$ENDC}
  524. FUNCTION SndControl(id: INTEGER; VAR cmd: SndCommand): OSErr;
  525.     {$IFC NOT GENERATINGCFM}
  526.     INLINE $A806;
  527.     {$ENDC}
  528. { Sound Manager 2.0 and later, uses _SoundDispatch }
  529. FUNCTION SndSoundManagerVersion: NumVersion;
  530.     {$IFC NOT GENERATINGCFM}
  531.     INLINE $203C, $000C, $0008, $A800;
  532.     {$ENDC}
  533. FUNCTION SndStartFilePlay(chan: SndChannelPtr; fRefNum: INTEGER; resNum: INTEGER; bufferSize: LONGINT; theBuffer: UNIV Ptr; theSelection: AudioSelectionPtr; theCompletion: FilePlayCompletionUPP; async: BOOLEAN): OSErr;
  534.     {$IFC NOT GENERATINGCFM}
  535.     INLINE $203C, $0D00, $0008, $A800;
  536.     {$ENDC}
  537. FUNCTION SndPauseFilePlay(chan: SndChannelPtr): OSErr;
  538.     {$IFC NOT GENERATINGCFM}
  539.     INLINE $203C, $0204, $0008, $A800;
  540.     {$ENDC}
  541. FUNCTION SndStopFilePlay(chan: SndChannelPtr; quietNow: BOOLEAN): OSErr;
  542.     {$IFC NOT GENERATINGCFM}
  543.     INLINE $203C, $0308, $0008, $A800;
  544.     {$ENDC}
  545. FUNCTION SndChannelStatus(chan: SndChannelPtr; theLength: INTEGER; theStatus: SCStatusPtr): OSErr;
  546.     {$IFC NOT GENERATINGCFM}
  547.     INLINE $203C, $0510, $0008, $A800;
  548.     {$ENDC}
  549. FUNCTION SndManagerStatus(theLength: INTEGER; theStatus: SMStatusPtr): OSErr;
  550.     {$IFC NOT GENERATINGCFM}
  551.     INLINE $203C, $0314, $0008, $A800;
  552.     {$ENDC}
  553. PROCEDURE SndGetSysBeepState(VAR sysBeepState: INTEGER);
  554.     {$IFC NOT GENERATINGCFM}
  555.     INLINE $203C, $0218, $0008, $A800;
  556.     {$ENDC}
  557. FUNCTION SndSetSysBeepState(sysBeepState: INTEGER): OSErr;
  558.     {$IFC NOT GENERATINGCFM}
  559.     INLINE $203C, $011C, $0008, $A800;
  560.     {$ENDC}
  561. FUNCTION SndPlayDoubleBuffer(chan: SndChannelPtr; theParams: SndDoubleBufferHeaderPtr): OSErr;
  562.     {$IFC NOT GENERATINGCFM}
  563.     INLINE $203C, $0420, $0008, $A800;
  564.     {$ENDC}
  565. { MACE compression routines }
  566. FUNCTION MACEVersion: NumVersion;
  567.     {$IFC NOT GENERATINGCFM}
  568.     INLINE $203C, $0000, $0010, $A800;
  569.     {$ENDC}
  570. PROCEDURE Comp3to1(inBuffer: UNIV Ptr; outBuffer: UNIV Ptr; cnt: LONGINT; inState: StateBlockPtr; outState: StateBlockPtr; numChannels: LONGINT; whichChannel: LONGINT);
  571.     {$IFC NOT GENERATINGCFM}
  572.     INLINE $203C, $0004, $0010, $A800;
  573.     {$ENDC}
  574. PROCEDURE Exp1to3(inBuffer: UNIV Ptr; outBuffer: UNIV Ptr; cnt: LONGINT; inState: StateBlockPtr; outState: StateBlockPtr; numChannels: LONGINT; whichChannel: LONGINT);
  575.     {$IFC NOT GENERATINGCFM}
  576.     INLINE $203C, $0008, $0010, $A800;
  577.     {$ENDC}
  578. PROCEDURE Comp6to1(inBuffer: UNIV Ptr; outBuffer: UNIV Ptr; cnt: LONGINT; inState: StateBlockPtr; outState: StateBlockPtr; numChannels: LONGINT; whichChannel: LONGINT);
  579.     {$IFC NOT GENERATINGCFM}
  580.     INLINE $203C, $000C, $0010, $A800;
  581.     {$ENDC}
  582. PROCEDURE Exp1to6(inBuffer: UNIV Ptr; outBuffer: UNIV Ptr; cnt: LONGINT; inState: StateBlockPtr; outState: StateBlockPtr; numChannels: LONGINT; whichChannel: LONGINT);
  583.     {$IFC NOT GENERATINGCFM}
  584.     INLINE $203C, $0010, $0010, $A800;
  585.     {$ENDC}
  586. { Sound Manager 3.0 and later calls }
  587. FUNCTION GetSysBeepVolume(VAR level: LONGINT): OSErr;
  588.     {$IFC NOT GENERATINGCFM}
  589.     INLINE $203C, $0224, $0018, $A800;
  590.     {$ENDC}
  591. FUNCTION SetSysBeepVolume(level: LONGINT): OSErr;
  592.     {$IFC NOT GENERATINGCFM}
  593.     INLINE $203C, $0228, $0018, $A800;
  594.     {$ENDC}
  595. FUNCTION GetDefaultOutputVolume(VAR level: LONGINT): OSErr;
  596.     {$IFC NOT GENERATINGCFM}
  597.     INLINE $203C, $022C, $0018, $A800;
  598.     {$ENDC}
  599. FUNCTION SetDefaultOutputVolume(level: LONGINT): OSErr;
  600.     {$IFC NOT GENERATINGCFM}
  601.     INLINE $203C, $0230, $0018, $A800;
  602.     {$ENDC}
  603. FUNCTION GetSoundHeaderOffset(sndHandle: SndListHandle; VAR offset: LONGINT): OSErr;
  604.     {$IFC NOT GENERATINGCFM}
  605.     INLINE $203C, $0404, $0018, $A800;
  606.     {$ENDC}
  607. FUNCTION UnsignedFixedMulDiv(value: UnsignedFixed; multiplier: UnsignedFixed; divisor: UnsignedFixed): UnsignedFixed;
  608.     {$IFC NOT GENERATINGCFM}
  609.     INLINE $203C, $060C, $0018, $A800;
  610.     {$ENDC}
  611. FUNCTION GetCompressionInfo(compressionID: INTEGER; format: OSType; numChannels: INTEGER; sampleSize: INTEGER; cp: CompressionInfoPtr): OSErr;
  612.     {$IFC NOT GENERATINGCFM}
  613.     INLINE $203C, $0710, $0018, $A800;
  614.     {$ENDC}
  615. FUNCTION SetSoundPreference(theType: OSType; VAR name: Str255; settings: Handle): OSErr;
  616.     {$IFC NOT GENERATINGCFM}
  617.     INLINE $203C, $0634, $0018, $A800;
  618.     {$ENDC}
  619. FUNCTION GetSoundPreference(theType: OSType; VAR name: Str255; settings: Handle): OSErr;
  620.     {$IFC NOT GENERATINGCFM}
  621.     INLINE $203C, $0638, $0018, $A800;
  622.     {$ENDC}
  623. { Sound Manager 3.1 and later calls }
  624. FUNCTION SndGetInfo(chan: SndChannelPtr; selector: OSType; infoPtr: UNIV Ptr): OSErr;
  625.     {$IFC NOT GENERATINGCFM}
  626.     INLINE $203C, $063C, $0018, $A800;
  627.     {$ENDC}
  628. FUNCTION SndSetInfo(chan: SndChannelPtr; selector: OSType; infoPtr: UNIV Ptr): OSErr;
  629.     {$IFC NOT GENERATINGCFM}
  630.     INLINE $203C, $0640, $0018, $A800;
  631.     {$ENDC}
  632. FUNCTION GetSoundOutputInfo(outputDevice: Component; selector: OSType; infoPtr: UNIV Ptr): OSErr;
  633.     {$IFC NOT GENERATINGCFM}
  634.     INLINE $203C, $0644, $0018, $A800;
  635.     {$ENDC}
  636. FUNCTION SetSoundOutputInfo(outputDevice: Component; selector: OSType; infoPtr: UNIV Ptr): OSErr;
  637.     {$IFC NOT GENERATINGCFM}
  638.     INLINE $203C, $0648, $0018, $A800;
  639.     {$ENDC}
  640. { Sound Manager 3.2 and later calls }
  641. FUNCTION GetCompressionName(compressionType: OSType; VAR compressionName: Str255): OSErr;
  642.     {$IFC NOT GENERATINGCFM}
  643.     INLINE $203C, $044C, $0018, $A800;
  644.     {$ENDC}
  645. FUNCTION SoundConverterOpen({CONST}VAR inputFormat: SoundComponentData; {CONST}VAR outputFormat: SoundComponentData; VAR sc: SoundConverter): OSErr;
  646.     {$IFC NOT GENERATINGCFM}
  647.     INLINE $203C, $0650, $0018, $A800;
  648.     {$ENDC}
  649. FUNCTION SoundConverterClose(sc: SoundConverter): OSErr;
  650.     {$IFC NOT GENERATINGCFM}
  651.     INLINE $203C, $0254, $0018, $A800;
  652.     {$ENDC}
  653. FUNCTION SoundConverterGetBufferSizes(sc: SoundConverter; inputBytesTarget: LONGINT; VAR inputFrames: LONGINT; VAR inputBytes: LONGINT; VAR outputBytes: LONGINT): OSErr;
  654.     {$IFC NOT GENERATINGCFM}
  655.     INLINE $203C, $0A58, $0018, $A800;
  656.     {$ENDC}
  657. FUNCTION SoundConverterBeginConversion(sc: SoundConverter): OSErr;
  658.     {$IFC NOT GENERATINGCFM}
  659.     INLINE $203C, $025C, $0018, $A800;
  660.     {$ENDC}
  661. FUNCTION SoundConverterConvertBuffer(sc: SoundConverter; inputPtr: UNIV Ptr; inputFrames: LONGINT; outputPtr: UNIV Ptr; VAR outputFrames: LONGINT; VAR outputBytes: LONGINT): OSErr;
  662.     {$IFC NOT GENERATINGCFM}
  663.     INLINE $203C, $0C60, $0018, $A800;
  664.     {$ENDC}
  665. FUNCTION SoundConverterEndConversion(sc: SoundConverter; outputPtr: UNIV Ptr; VAR outputFrames: LONGINT; VAR outputBytes: LONGINT): OSErr;
  666.     {$IFC NOT GENERATINGCFM}
  667.     INLINE $203C, $0864, $0018, $A800;
  668.     {$ENDC}
  669. CONST
  670.     uppSndCallBackProcInfo = $000003C0; { PROCEDURE (4 byte param, 4 byte param); }
  671.  
  672. FUNCTION NewSndCallBackProc(userRoutine: SndCallBackProcPtr): SndCallBackUPP;
  673.     {$IFC NOT GENERATINGCFM }
  674.     INLINE $2E9F;
  675.     {$ENDC}
  676.  
  677. PROCEDURE CallSndCallBackProc(chan: SndChannelPtr; VAR cmd: SndCommand; userRoutine: SndCallBackUPP);
  678.     {$IFC NOT GENERATINGCFM}
  679.     INLINE $205F, $4E90;
  680.     {$ENDC}
  681.  
  682. {$ALIGN RESET}
  683. {$POP}
  684.  
  685. {$SETC UsingIncludes := SoundIncludes}
  686.  
  687. {$ENDC} {__SOUND__}
  688.  
  689. {$IFC NOT UsingIncludes}
  690.  END.
  691. {$ENDC}
  692.